package com.gupao.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.ClientDetailsService;
import org.springframework.security.oauth2.provider.ClientRegistrationException;
import org.springframework.stereotype.Component;

import com.gupao.entity.OauthClientDetails;
import com.gupao.service.OauthClientDetailsService;

@Component
public class BossCustomClientDetailsService implements ClientDetailsService {
	
	@Autowired
	OauthClientDetailsService oauthClientDetailsService;

	public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException {
		OauthClientDetails  oauthClientDetails=oauthClientDetailsService.selectByClientId(clientId);
		MobileClientDetails details=new MobileClientDetails(oauthClientDetails);
		return details;
	}

}
